package com.eliza.lifecycle.observer

import android.util.Log
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner


/*-*- coding:utf-8 -*-
 * @Author  : debi
 * @Time    : 3/23/22
 * @Software: Android Studio
 */
/**
 * 推荐使用
 * */
class NewDefaultLcObserver : DefaultLifecycleObserver {
    override fun onCreate(owner: LifecycleOwner) {
        super.onCreate(owner)
        Log.i(this::class.java.name, "onCreate")
    }

    override fun onStart(owner: LifecycleOwner) {
        super.onStart(owner)
        Log.i(this::class.java.name, "onStart")

    }

    override fun onResume(owner: LifecycleOwner) {
        super.onResume(owner)
        Log.i(this::class.java.name, "onResume")

    }

    override fun onPause(owner: LifecycleOwner) {
        super.onPause(owner)
        Log.i(this::class.java.name, "onPause")

    }

    override fun onStop(owner: LifecycleOwner) {
        super.onStop(owner)
        Log.i(this::class.java.name, "onStop")

    }

    override fun onDestroy(owner: LifecycleOwner) {
        super.onDestroy(owner)
        Log.i(this::class.java.name, "onDestroy")

    }
}